;(function($){ 
	$.global={
			 /**
			  * 时间戳转换时间格式
			  * @param now
			  * @returns {String}
			  */
		formatDateT:function(now) { 
			var time=new Date(now); 
			var y = time.getFullYear();
			var m = time.getMonth()+1;
			var d = time.getDate();
			var h = time.getHours();
			var mm = time.getMinutes();
			var s = time.getSeconds();
			return y+'-'+(m<10?'0'+m:m)+'-'+(d<10?'0'+d:d)+' '+(h<10?'0'+h:h)+':'+(mm<10?'0'+mm:mm)+':'+(s<10?'0'+s:s);
		},
		setCookie:function(name,value){//存入cookie中
		var Days = 30;
		var exp = new Date();
		exp.setTime(exp.getTime() + Days*24*60*60*1000);
		document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
		},
		getCookie:function(name){//获取cookie
		var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
		if(arr=document.cookie.match(reg))
		return unescape(arr[2]);
		else
		return null;
		},
		delCookie:function (name){//删除cookie
		var exp = new Date();
		exp.setTime(exp.getTime() - 1);
		var cval=getCookie(name);
		if(cval!=null)
		document.cookie= name + "="+cval+";expires="+exp.toGMTString();
		}
		,compareDate:function(a, b) {//日期大小比较
		    var arr = a.split("-");
		    var starttime = new Date(arr[0], arr[1], arr[2]);
		    var starttimes = starttime.getTime();

		    var arrs = b.split("-");
		    var lktime = new Date(arrs[0], arrs[1], arrs[2]);
		    var lktimes = lktime.getTime();

		    if (starttimes > lktimes) {
		        return false;
		    }
		    else
		        return true;
		}
		,showMask:function(obj){//遮罩层
			debugger;
			var msg=obj['msg']?obj['msg']:'正在加载...';
			var w=obj['width']?obj['width']:'110px';
			var h=obj['height']?obj['height']:'30px';
			$("#global_mask").css({
				'display': 'block'
			});
			$("#global_mask_msg").css({
				'display':'block',
				'width':w,
				'height':h
			});
			$("#global_mask_msg").html(msg);
			
		},closeMask:function(){
			$("#global_mask").css({
				'display': 'none'
			});
			$("#global_mask_msg").css({
				'display':'none'
			});
		}
	};
})(jQuery);

$(function(){
	var maskDiv="<div id='global_mask' style='display: none; " +
	"position:fixed; top: 0%; left: 0%; width: 100%;" +
	" height: 100%; background-color:rgb(0, 0, 0);" +
	" z-index:1001; -moz-opacity: 0.6; opacity:.60; cursor:wait;" +
	" filter: alpha(opacity=60); '>"
	+"</div><div id='global_mask_msg' style='display: none;position: fixed;border:none; top: 28%; left: 44%; " +
			"width: 250px; height: 30px; padding-top:12px;text-align:center;" +
			"background-color: rgb(0, 0, 0);opacity:0.5; overflow: auto;" +
			" z-index:1002;  color:rgb(255, 255, 255); cursor:default; font-weight:bold; border-radius:10px;'>请稍后...</div>"
$(maskDiv).appendTo("body"); 
});
